package com.appserver.web.dto;

import javax.validation.constraints.NotEmpty;
import java.util.stream.Stream;

/**
 * Created by guoyanjiang on 2018/4/12.
 */
public class InitModel {

    private String imei;

    private String mac;

    private String sn;

    private String deviceid;

    @NotEmpty(message = "version {require}")
    private String version;

    private String xinge;

    private String cid;

    private String channel_id;

    public String getImei() {
        return imei;
    }

    public void setImei(String imei) {
        this.imei = imei;
    }

    public String getMac() {
        return mac;
    }

    public void setMac(String mac) {
        this.mac = mac;
    }

    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    public String getDeviceid() {
        return deviceid;
    }

    public void setDeviceid(String deviceid) {
        this.deviceid = deviceid;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getXinge() {
        return xinge;
    }

    public void setXinge(String xinge) {
        this.xinge = xinge;
    }

    public String getChannel_id() {
        return channel_id;
    }

    public void setChannel_id(String channel_id) {
        this.channel_id = channel_id;
    }

    public boolean isParamsAllEmpty() {
        return !Stream.of(imei, mac, sn, deviceid).anyMatch(param -> param != null);
    }

    public String getCid() {
        return cid;
    }

    public void setCid(String cid) {
        this.cid = cid;
    }

    @Override
    public String toString() {
        return "InitModel{" +
                "imei='" + imei + '\'' +
                ", mac='" + mac + '\'' +
                ", sn='" + sn + '\'' +
                ", deviceid='" + deviceid + '\'' +
                ", version='" + version + '\'' +
                ", xinge='" + xinge + '\'' +
                ", cid='" + cid + '\'' +
                ", channel_id='" + channel_id + '\'' +
                '}';
    }
}
